package com.suineg.pms.commons;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 *@author Suine
 */
public class AppLoadListener implements ServletContextListener{
	/** 日志输出对象 */
	protected final Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		logger.info("项目正在启动..");
		logger.info("初始化Appconfig.");
		AppConfig config = AppConfig.getInstance();
		ServletContext application = sce.getServletContext();
		config.setApplication(application);
		logger.info("初始化Appconfig完成.");
	}

}

